<template>
	<view class="container">
		<view class="flex wallet_1">
			<view class="text">
				可用余额（元）
			</view>
			<view class="money">
				{{userInfo.money}}
			</view>
			<view class="btn" @click="onwithdraw">
				提现
			</view>
		</view>
		<view class="flex hcenter wallet_2" @click="onlist">
			<view class="flex hcenter">
				<image style="width: 38rpx;height: 42rpx;margin-right: 18rpx;" src="/static/img/jyjl.png" mode="">
				</image>
				<view class="">
					交易记录
				</view>
			</view>
			<image style="width: 38rpx;height: 42rpx;" src="/static/img/yjtBlack.png" mode=""></image>
		</view>

	</view>
</template>


<script>
	import {
		useStore
	} from '@/store/index.js'
	import {
		onLoad,
		onUnload
	} from "@dcloudio/uni-app"
	import {
		reactive,
		toRefs,
		ref,
		watch,
		computed,
		onMounted,
	} from "vue"
	export default {

		setup() {
			const store = useStore()
			const state = reactive({
				userInfo: computed(() => store.userInfo),
				yuyuelist: [{}, {}, {}],
				pinlunlist: [{}, {}],
				id: '',
				title: '',
				num: 1
			})
			onLoad((option) => {
				console.log(option);
				store.getUserInfo()
				state.id = option.id;
				state.title = option.name;
				uni.setNavigationBarTitle({
					title: '我的钱包',
				})
			})

			const getData = async () => {


			}
			const onwithdraw = async () => {
				uni.navigateTo({
					url:"/subpages/wallet/withdraw"
				})

			}
			const onlist = async () => {
				uni.navigateTo({
					url:"/subpages/wallet/list"
				})

			}
			return {
				...toRefs(state),
				onwithdraw,
				onlist
			}
		}

	}
</script>
<style>
	page {
		background-color: #EFEFEF;
	}
</style>
<style lang="scss" scoped>
	/* #ifdef H5 */
	page {
		height: auto;
		min-height: 100%;
	}

	/* #endif */
	.container {
		min-height: 100%;
		background: rgb(244, 244, 244);
	}

	.wallet_1 {
		padding: 60rpx 0;
		background: #fff;
		text-align: center;
		flex-direction: column;
		align-items: center;
		font-size: 36rpx;

		.text {
			color: #aeaeae;
		}

		.money {
			font-size: 70rpx;
		}

		.btn {
			margin-top: 64rpx;
			background: #00be4c;
			height: 60rpx;
			line-height: 60rpx;
			width: 188rpx;
			color: #fff;
			border-radius: 60rpx;
		}
	}

	.wallet_2 {
		padding: 36rpx;
		margin-top: 38rpx;
		background: #fff;
		justify-content: space-between
	}
</style>